<%@ Page Language="C#" AutoEventWireup="false" MasterPageFile="~/default.master"
    Inherits="MediaMonitor.Login" Title="Please Login" ValidateRequest="false" Theme="default"
    CodeBehind="login.aspx.cs" %>

<%@ Register TagPrefix="ctrl" TagName="ForgotPass" Src="~/controls/user-management/forgot-password.ascx" %>
<asp:Content ID="Content1" ContentPlaceHolderID="Body" runat="Server">
    <asp:UpdatePanel ID="pnlUpdate" runat="server">
        <ContentTemplate>
            <table border="0" cellpadding="5" cellspacing="4" align="center" style="text-align: left">
                <tr valign="top">
                    <td align="center">
                        <fieldset>
                            <asp:UpdatePanel ID="pnlUpldateLoginx" runat="server" UpdateMode="Conditional">
                                <ContentTemplate>
                                    <table width="100%">
                                        <tr>
                                            <td>
                                                <h2>
                                                    <asp:Literal ID="ltrHeading" runat="server" /></h2>
                                                <asp:Login ID="loginx" runat="server" OnAuthenticate="login_Authenticate">
                                                    <LayoutTemplate>
                                                        <asp:Panel ID="pnlLoginx" runat="server" DefaultButton="LoginButton">
                                                            <div align="center">
                                                                <center>
                                                                    <td>
                                                                        <div class="input-box">
                                                                            <div class="input">
                                                                                <asp:TextBox ID="UserName" runat="server" placeholder="Email or Username" class="xlarge"></asp:TextBox>
                                                                                <asp:RequiredFieldValidator ID="UserNameRequired" runat="server" ControlToValidate="UserName"
                                                                                    Width="150" Display="Dynamic" ErrorMessage="User Name is required." ToolTip="User Name is required."
                                                                                    ValidationGroup="loginx">*</asp:RequiredFieldValidator>
                                                                            </div>
                                                                        </div>
                                                                        <div class="input-box">
                                                                            <div class="input">
                                                                                <asp:TextBox ID="Password" placeholder="Password" class="xlarge" runat="server" TextMode="Password"></asp:TextBox>
                                                                                <asp:RequiredFieldValidator ID="PasswordRequired" runat="server" ControlToValidate="Password"
                                                                                    Display="Dynamic" ErrorMessage="Password is required." ToolTip="Password is required."
                                                                                    ValidationGroup="loginx">*</asp:RequiredFieldValidator>
                                                                                <a href="/reset-password" tabindex="-1" class="action">Forgot your password?</a>
                                                                            </div>
                                                                        </div>
                                                                        <div style="" class="remember-container">
                                                                            <div class="input">
                                                                                <label>
                                                                                    <asp:CheckBox ID="RememberMe" runat="server" Text="" Font-Size="Smaller" />
                                                                                    <span>Remember me</span>
                                                                                </label>
                                                                            </div>
                                                                        </div>
                                                                        <table>
                                                                            <tr>
                                                                                <td>
                                                                                    <asp:Label ID="lblErrorMsg" runat="server"></asp:Label>
                                                                                    <asp:Literal ID="FailureText" runat="server" EnableViewState="False"></asp:Literal>
                                                                                </td>
                                                                            </tr>
                                                                            <tr>
                                                                                <td>
                                                                                </td>
                                                                                <td align="left">
                                                                                    <br />
                                                                                    <asp:Button ID="LoginButton" runat="server" CssClass="btn primary submit large" ValidationGroup="loginx"
                                                                                        CommandName="Login" Text="Sign In" />
                                                                                    <br />
                                                                                    <br />
                                                                                    <div style="float: right; padding-top: 4px; display: none;">
                                                                                        Not already registered?
                                                                                        <br />
                                                                                        <asp:HyperLink ID="lnkReg" runat="server" Text=" Register Now" Style="cursor: pointer" />
                                                                                    </div>
                                                                                </td>
                                                                            </tr>
                                                                        </table>
                                                                    </td>
                                                                </center>
                                                            </div>
                                                        </asp:Panel>
                                                    </LayoutTemplate>
                                                </asp:Login>
                                            </td>
                                        </tr>
                                    </table>
                                </ContentTemplate>
                            </asp:UpdatePanel>
                            <fieldset>
                    </td>
                </tr>
            </table>
            <br />
            <br />
            <div align="center" style="display: none;">
                <asp:PasswordRecovery ID="pwdRecovery" runat="server" SuccessText="Your password has been sent to your email address">
                    <UserNameTemplate>
                        <asp:Panel ID="pnlPwd" runat="server" DefaultButton="SubmitButton" EnableViewState="false">
                            <center>
                                <table border="0" cellpadding="1" cellspacing="5" align="center" style="text-align: left;"
                                    width="300">
                                    <tr>
                                        <td>
                                            <table border="0" cellpadding="0" align="center">
                                                <tr>
                                                    <td align="left" colspan="2" class="ErrorText Bold">
                                                        Forgot Your Password?
                                                        <br />
                                                        <br />
                                                    </td>
                                                    <td width="80">
                                                    </td>
                                                </tr>
                                                <tr>
                                                    <td align="left" colspan="2">
                                                        Enter your User Name to receive your password.<br />
                                                        <br />
                                                    </td>
                                                    <td>
                                                    </td>
                                                </tr>
                                                <tr valign="middle">
                                                    <td>
                                                        <asp:Label ID="UserNameLabel" runat="server" AssociatedControlID="UserName" EnableViewState="false">Username/Email: </asp:Label>
                                                    </td>
                                                    <td>
                                                        <asp:TextBox ID="UserName" runat="server" EnableViewState="false" Width="130" ValidationGroup="ctl00@pwdRecovery1"></asp:TextBox>
                                                        <asp:RequiredFieldValidator ID="UserNameRequired" runat="server" EnableViewState="false"
                                                            ControlToValidate="UserName" ErrorMessage="User Name is required." ToolTip="User Name is required."
                                                            ValidationGroup="ctl00$pwdRecovery1">*</asp:RequiredFieldValidator>
                                                    </td>
                                                    <td>
                                                    </td>
                                                </tr>
                                                <tr>
                                                    <td align="center" colspan="3" style="color: Red;">
                                                        <asp:Literal ID="FailureText" runat="server" EnableViewState="False"></asp:Literal>
                                                    </td>
                                                </tr>
                                                <tr>
                                                    <td>
                                                    </td>
                                                    <td>
                                                        <asp:ImageButton ID="SubmitButton" runat="server" CommandName="Submit" ValidationGroup="ctl00$pwdRecovery1"
                                                            SkinID="Submit" EnableViewState="false" />
                                                    </td>
                                                    <td>
                                                    </td>
                                                </tr>
                                            </table>
                                        </td>
                                    </tr>
                                </table>
                            </center>
                        </asp:Panel>
                    </UserNameTemplate>
                </asp:PasswordRecovery>
            </div>
            <asp:SqlDataSource ID="SqlDataSource1" ConnectionString="<%$ ConnectionStrings:DBAdex %>"
                runat="server" UpdateCommand="update siteuser set IsLoggedIn=1 where siteuserId=@SiteUserID">
            </asp:SqlDataSource>
        </ContentTemplate>
    </asp:UpdatePanel>
</asp:Content>
